//
//  LJP_SearchPlaceCell.m
//  God_is_a_Girl
//
//  Created by 李继鹏 on 15/9/29.
//  Copyright (c) 2015年 呸. All rights reserved.
//

#import "LJP_SearchPlaceCell.h"
#import "LJP_SearchTripsModel.h"
#import <UIImageView+WebCache.h>
@implementation LJP_SearchPlaceCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.picture = [[UIImageView alloc] init];
        [self.contentView addSubview:self.picture];
        self.title = [[UILabel alloc] init];
        self.title.font = [UIFont systemFontOfSize:18];
        self.title.numberOfLines = 0;
        self.time = [[UILabel alloc] init];
        self.time.font = [UIFont systemFontOfSize:13];
        [self.contentView addSubview:self.time];
        [self.contentView addSubview:self.title];
        
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.picture.frame = CGRectMake(10, 10, 100, 75);
    self.title.frame = CGRectMake(120, 5, [UIScreen mainScreen].bounds.size.width - 140, 50);
    self.time.frame = CGRectMake(120, self.contentView.frame.size.height - 30,[UIScreen mainScreen].bounds.size.width - 140, 20);
    
    
}
- (void)setModel:(LJP_SearchTripsModel *)model
{
    if (model != _model) {
        _model = model;
    }
    [self.picture sd_setImageWithURL:[NSURL URLWithString:_model.cover_image] placeholderImage:[UIImage imageNamed:@"search"]];
    self.title.text = _model.name;
    self.time.text = [NSString stringWithFormat:@"行程%@天", _model.day_count];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
